<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ include file="international.jsp" %>
<%
String url = request.getRequestURI();
String cls = "class=\"hmenu\" style=\"background-image: url(images/tabbg2.gif);\"";

String topWidth = session.getAttribute(Constants.TOP_WIDTH) == null ? "208px":session.getAttribute(Constants.TOP_WIDTH).toString();

%>

<%@page import="java.util.TimeZone"%>
<%@page import="sun.util.resources.TimeZoneNames"%>

<table height="60" class="gpsTopTable" width="100%" cellpadding="0" border="0">
			<tr>
				<td width="<%=topWidth %>"  style="height:60px;padding-left:5px; padding-top:2px;" align="left">
					<img src="images/Earth_01.png" style="display:none" alt="GPS Online Tracking System"/>
					<!--<span class="companyTitle">GPS Online Tracking System</span> Beta-->
				<td> 
				<td align="right" height="100%" valign="bottom">
					<script>
						function SetCookie(name, value)
						{
						var expdate = new Date();
						var argv = SetCookie.arguments;
						var argc = SetCookie.arguments.length;
						var expires = (argc > 2) ? argv[2] : null;
						var path = (argc > 3) ? argv[3] : null;
						var domain = (argc > 4) ? argv[4] : null;
						var secure = (argc > 5) ? argv[5] : false;
						if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 ));
						document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
						+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
						+((secure == true) ? "; secure" : "");
						}					
					</script>
					<table height="100%" width="100%"  cellpadding="0" >

						
						<tr valign="bottom">
							<td colspan="2">
							<table cellspacing="0" cellpadding="0" border="3"  class="gn_text">
							  <tr class="a_text"  align="center">
							  											
								<td nowrap="nowrap"><a <%=url.indexOf("gps_location.jsp")>-1 ? cls:"" %>  href="gps_location.jsp"><fmt:message key="top.map"/></a></td>
										
								<td nowrap="nowrap"><a <%=url.indexOf("gps_realtime.jsp")>-1 ? cls:"" %> href="gps_realtime.jsp" ><fmt:message key="top.realtime"/></a></td>
										
								<td nowrap="nowrap"><a <%=url.indexOf("gps_history.jsp")>-1 ? cls:"" %> href="gps_history.jsp" ><fmt:message key="top.history"/></a></td>

										
								<td nowrap="nowrap"><a <%=url.indexOf("gps_report.jsp")>-1 ? cls:"" %> href="gps_report.jsp" ><fmt:message key="top.report"/></a></td>
										
								<td nowrap="nowrap"><a <%=(url.indexOf("gps_product.jsp")>-1 
										|| url.indexOf("gps_editproduct.jsp")>-1||
										url.indexOf("users.jsp")>-1 || url.indexOf("edituser.jsp")>-1||
										url.indexOf("gps_email_setting.jsp")>-1||
										url.indexOf("gps_password.jsp")>-1) ? cls:"" %> href="gps_product.jsp" ><fmt:message key="top.manage"/></a></td>
										
								
																<!--
								<td><a class="hmenu" style="background-repeat:no-repeat; background-image: url(images/tabbg2.gif);" href="{href}">{name}</a></td>
							  	-->
								<td width="100%" height="100%">								
								</td>
							  </tr>
							</table>

							</td>
							
							<td align="right" valign="top" height="20px" style="padding-top:2px; padding-right:2px;" nowrap="nowrap">
							<%
							com.brother.model.Customer loginUser = (com.brother.model.Customer)session.getAttribute(com.brother.Constants.LOGIN_SESSTION_NAME);
							if(loginUser != null){
							%>
							<fmt:message key="top.welcome"/>, <%=loginUser.getName()%>&nbsp;&nbsp;<a href="login.jsp?action=logout"><fmt:message key="user.logout"></fmt:message></a>&nbsp;&nbsp;&nbsp;<fmt:message key="user.timeZone"></fmt:message>:<%=loginUser.getTimeZoneOffSet()%>
							<%}else{ %><a href=login.jsp><fmt:message key="user.login"></fmt:message></a><%} %>&nbsp;&nbsp;							</td>
							<td align="right" valign="top" height="20px" style="padding-top:2px; padding-right:20px;">[
															&nbsp;<a href="#" onclick="SetCookie('language', 'en', 24*60*60*1000*30);location.reload();">English</a>&nbsp;
															&nbsp;<a href="#" onclick="SetCookie('language', 'zh', 24*60*60*1000*30);location.reload();">中文</a>&nbsp;
							]
							</td>							
						</tr>
					</table>
				</td>

			</tr>
</table>
		<table style="background-image: url(images/topbg.gif);" height="5" width="100%">
			<tr>
				<td><div id="tmp_pos" name="tmp_pos" style="display:none"></div></td>
			</tr>
		</table>